<div class="layui-card">
    <div class="layui-card-body ">
        <form action="" method="post" class="layui-form delete-form " id="cp-form">
            <div class="layui-btn-group">
                <a href="" class="layui-btn layui-btn-xs">
                    插件列表
                </a>
            </div>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>插件名称</th>
                    <th>插件标识</th>
                    <th>描述</th>
                    <th>作者</th>
                    <th width="60">状态</th>
                    <th width="220">操作</th>
                </tr>
                </thead>
                <tbody>
                <?php
                    $status=array("1"=>'开启',"0"=>'禁用',"3"=>'未安装');
                ?>
                {volist name="plugins" id='vo'}
                    <tr>
                        <td>{$vo.title}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.description}</td>
                        <td>{$vo.author}</td>
                        <td>{$status[$vo['status']]}</td>
                        <td>
                            <div class="layui-btn-group">
                                {if $vo['status']==3 }
                                <a class="layui-btn layui-btn-xs js-ajax-dialog-btn"
                                   href="{:url('admin/plugin.plugin/install',array('name'=>$vo['name']))}"
                                   data-msg="确定安装该插件吗？">安装</a>
                                {else/}
                                <?php $config=json_decode($vo['config'],true);?>
                                <!--设置项-->
                                {if !empty($config)}
                                {empty name="config.custom_config"}
                                <a class="layui-btn layui-btn-xs"
                                   href="{:url('admin/plugin.plugin/setting',array('id'=>$vo['id']))}">设置</a>
                                {else/}
                                <a class="layui-btn layui-btn-xs" href="{:addons_url($vo['name'].'://admin_index/setting')}">设置</a>
                                {/empty}
                                {else/}
                                <a class="layui-btn layui-btn-xs  layui-btn-disabled" href="javascript:;">设置</a>
                                {/if}
                                <!--管理项-->
                                {if !empty($vo['has_admin'])}
                                <a class="layui-btn layui-btn-xs"
                                   href="{:addons_url($vo['name'].'://Admin_index/index')}">管理</a>
                                {else /}
                                <a class="layui-btn layui-btn-xs  layui-btn-disabled" href="javascript:;">管理</a>
                                {/if}
                                <!--更新项-->
                                <a class="layui-btn layui-btn-xs layui-btn-warm js-ajax-dialog-btn "
                                   href="{:url('admin/plugin.plugin/update',array('name'=>$vo['name']))}" data-msg="确定更新该插件吗？">更新</a>
                                <!--状态项-->
                                {if $vo['status']==0}
                                <a class="layui-btn layui-btn-xs js-ajax-dialog-btn"
                                   href="{:url('admin/plugin.plugin/toggle',array('id'=>$vo['id'],'enable'=>1))}"
                                   data-msg="确定启用该插件吗？">启用</a>
                                {else/}
                                <a class="layui-btn layui-btn-xs js-ajax-dialog-btn  layui-btn-primary"
                                   href="{:url('admin/plugin.plugin/toggle',array('id'=>$vo['id'],'disable'=>1))}"
                                   data-msg="确定禁用该插件吗？">禁用</a>
                                {/if}
                                <!--卸载项-->
                                <a class="layui-btn layui-btn-xs js-ajax-dialog-btn layui-btn-danger"
                                   href="{:url('admin/plugin.plugin/uninstall',array('id'=>$vo['id']))}" data-msg="确定卸载该插件吗？">卸载</a>
                                {/if}
                            </div>
                        </td>
                    </tr>
                {/volist}
                </tbody>
            </table>
        </form>
    </div>
</div>
